var express = require('express');
var router = express.Router();
const filmAndCinemaService = require('../service/filmAndCinemaService');

router.get('/films/:filmId/cinemas/:cinemaId',async function(req, res, next) {
    res.send(await filmAndCinemaService.findByFilmIdAndCinemaId(req.params.filmId,req.params.cinemaId));
});
router.put('/:id',async function(req, res, next) {
    req.body.schedule = JSON.parse(req.body.schedule);
    res.send(await filmAndCinemaService.update(req.params.id,req.body));
});

module.exports = router;
